<template>
	<view class="container">
		<u-navbar bgColor="#0e3a5e" title="操作" :autoBack="true" :placeholder="true" leftIconColor="#fff"
			:titleStyle="titleStyle">
		</u-navbar>
		<view class="pdBox">
			<view class="card" @click="goProcess">
				<u--image src="../../static/gxtj.png" width="250rpx" height="250rpx"></u--image>
				<text>工序提交</text>
			</view>
			<view class="card" @click="goToKeyImportant">
				<u--image src="../../static/gzjsc.png" width="250rpx" height="250rpx"></u--image>
				<text>关重件上传</text>
			</view>
			<view class="card" @click="goMasterShortAge">
				<u--image src="../../static/qlsc.png" width="250rpx" height="250rpx"></u--image>
				<text>缺料报工</text>
			</view>
			<view class="card" @click="goAbnormal">
				<u--image src="../../static/jlyc.png" width="250rpx" height="250rpx"></u--image>
				<text>装配异常记录</text>
			</view>
			<view class="card" @click="goUnqualified">
				<u--image src="../../static/zzbhgjl.png" width="250rpx" height="250rpx"></u--image>
				<text>制造过程不合格记录</text>
			</view>
			<view class="card" @click="goHandover('offline_inspection')">
				<u--image src="../../static/xxdjb.png" width="250rpx" height="250rpx"></u--image>
				<text>下线点检</text>
			</view>
			<view class="card" @click="goHandover('handover')">
				<u--image src="../../static/zxjjgzb.png" width="250rpx" height="250rpx"></u--image>
				<text>转序交接</text>
			</view>
			<view class="card" @click="goRectification">
				<u--image src="../../static/zgjl.png" width="250rpx" height="250rpx"></u--image>
				<text>整改记录</text>
			</view>
			<view class="card" @click="goEndCheck">
				<u--image src="../../static/chj.png" width="250rpx" height="250rpx"></u--image>
				<text>入库检</text>
			</view>
			<view class="card" @click="goShakeDown">
				<u--image src="../../static/bom.png" width="250rpx" height="250rpx"></u--image>
				<text>一机一Boom</text>
			</view>
		</view>
		
	</view>
</template>

<script lang="ts">
	import { defineComponent, reactive, toRefs } from "vue";
	import { onLoad } from "@dcloudio/uni-app";
	const productAction = defineComponent({
		name: 'productAction',
		setup() {
			const data = reactive({
				planInfo: {},
				titleStyle: {
					color: '#fff',
					fontSize: '34rpx',
					fontWeight: '600'
				},
			})
			onLoad((option) => {
				data.planInfo = JSON.parse(option.data)
			})
			const goProcess = () => {
				uni.navigateTo({
					url:'/pages/process/process?planEqmId=' + data.planInfo.id
				})
			}
			const goToKeyImportant = () =>{
				uni.navigateTo({
					url: '/pages/keyImportant/index?planEqmId=' + data.planInfo.id
				})
			}
			const goMasterShortAge = () =>{
				uni.navigateTo({
					url: '/pages/masterShortAge/masterShortAge?planEqmId=' + data.planInfo.id
				})
			}
			const goAbnormal = () =>{
				uni.navigateTo({
					url: '/pages/abnormal/abnormal?planEqmId=' + data.planInfo.id
				})
			}
			const goHandover = (e) =>{
				uni.navigateTo({
					url: '/pages/goHandover/goHandover?planEqmId=' + data.planInfo.id + '&typeName=' + e
				})
			}
			const goRectification = (e) =>{
				uni.navigateTo({
					url: '/pages/rectification/rectification?planEqmId=' + data.planInfo.id
				})
			}
			const goEndCheck = (e) =>{
				uni.navigateTo({
					url: '/pages/endCheck/endCheck?planEqmId=' + data.planInfo.id
				})
			}
			const goUnqualified = (e) =>{
				uni.navigateTo({
					url: '/pages/unqualfied/unqualfied?planEqmId=' + data.planInfo.id
				})
			}
			const goShakeDown = (e) =>{
				uni.navigateTo({
					url: '/pages/shakeDown/index?planEqmId=' + data.planInfo.id
				})
			}
			return {
				...toRefs(data),
				goProcess,
				goToKeyImportant,
				goMasterShortAge,
				goHandover,
				goAbnormal,
				goRectification,
				goEndCheck,
				goUnqualified,
				goShakeDown
			}
		}
	})
	export default productAction;
</script>

<style lang="scss" scoped>
	.container {
		
		.pdBox{
			background-color: #f6f6f6;
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
		}
		.card {
			width: 36%;
			margin-bottom: 24rpx;
			background-color: #fff;
			box-shadow: 0 0 10rpx 0 #eeeeee;
			overflow: hidden;
			padding: 40rpx;
			text-align: center;
			font-weight: bold;
			color: #0E3A5E;
			font-family: PingFang SC-Semibold, PingFang SC;
			display: flex;
			justify-content: center;
			flex-direction: column;
			align-items: center;
			font-size: 30rpx;
			border-radius: 22rpx 22rpx 22rpx 22rpx;
		}
	}
</style>